

package kr.ac.ssu.yoobh17.mPlayer.list_play;


import kr.ac.ssu.yoobh17.mPlayer.R;

import android.content.Context;
import android.database.Cursor;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CursorAdapter;
import android.widget.TextView;


public class SelectedPlayListCursorAdapter extends CursorAdapter {
	
	public SelectedPlayListCursorAdapter(Context context, Cursor c) {
		super(context, c, true);
		// TODO Auto-generated constructor stub
	}
	
	public SelectedPlayListCursorAdapter(Context context, Cursor c, boolean autoRequery) {
		super(context, c, autoRequery);
		// TODO Auto-generated constructor stub
	}

	@Override
	public View newView(Context context, Cursor cursor, ViewGroup parent) {
		// TODO Auto-generated method stub
		
		LayoutInflater 	layoutInflater 	= LayoutInflater.from(context);
		View 			mapingLayout 	= layoutInflater.inflate(R.layout.listview_item_selected_playlist, null);
		
		return mapingLayout;
	}

	@Override
	public void bindView(View view, Context context, Cursor cursor) {
		// TODO Auto-generated method stub

		TextView 	textView_musicTitle 	= (TextView) view.findViewById( R.id.textView_musicTitleItemInSelectedPlayList );
		TextView 	textView_artistTitle 	= (TextView) view.findViewById( R.id.textView_artistItemInSelectedPlayList );
		
		Long		audioId					= cursor.getLong	( 1 );
		String 		musicTitle				= cursor.getString	( 2 );
		String		artist					= cursor.getString	( 3 );
		
		view.setTag( audioId );
		textView_musicTitle.setText( musicTitle );
		textView_artistTitle.setText( artist );
		
	}

}































